/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import React, { useEffect } from 'react';
import AliappInfoHeader from './components/header';
import AliappInfoPersonal from './components/personal';
import AliappInfoPost from './components/post';
import { useModel, history } from 'umi';

const MiniAliappInfoIndex = () => {
  const { info } = useModel('mini_aliapp');
  useEffect(() => {
    if (!info) {
      history.goBack();
    }
  }, [info]);

  const showPost = !info?.merchant;

  return (
    <div>
      <AliappInfoHeader />
      {showPost ? <AliappInfoPost /> : <AliappInfoPersonal />}
    </div>
  );
};

export default MiniAliappInfoIndex;
